package com.jushu.storbox.handler;

import android.os.Message;

import com.jushu.storbox.constant.UiConstant;
import com.jushu.storbox.entities.FileFolderInfo;
import com.jushu.storbox.vo.PagedList;
import com.huawei.sharedrive.sdk.android.modelV2.request.ShareInfo;
import com.huawei.sharedrive.sdk.android.modelV2.request.SharedUserV2;

public abstract class ActionShareHandler extends ClientExceptionRelateHandler {

	@SuppressWarnings("unchecked")
	@Override
	public void handleMessage(Message msg) {
		switch(msg.what) {
		case UiConstant.SHARE_ACTION_EXECUTE_SHARE_SHIPS_SUCCESS:
			handleExecuteShareSuccess(msg, (ShareInfo) msg.obj);
			break;
		case UiConstant.SHARE_ACTION_DELETE_SHARE_SHIPS_SUCCESS:
			handleDeleteShareSuccess(msg, (SharedUserV2) msg.obj);
			break;
		case UiConstant.SHARE_ACTION_GET_SHARE_RESOURCE_BYME:
			handleGetResourceByMe(msg, (PagedList<FileFolderInfo>) msg.obj);
			break;
		case UiConstant.SHARE_ACTION_GET_SHARE_RESOURCE_TOME:
			handleGetResourceToMe(msg, (PagedList<FileFolderInfo>) msg.obj);
			break;
		default:
			super.handleMessage(msg);
		}
	}
	
	protected void handleExecuteShareSuccess(Message msg,ShareInfo shareInfo){ }
	protected void handleDeleteShareSuccess(Message msg, SharedUserV2 sharedUser){ }
	protected void handleGetResourceByMe(Message msg, PagedList<FileFolderInfo> response){ }
	protected void handleGetResourceToMe(Message msg, PagedList<FileFolderInfo> response){ }
}
